//
//  OneTableViewCell.m
//  CarHome
//
//  Created by 蒋寒霄 on 14-9-19.
//  Copyright (c) 2014年 WJN_work@163.com. All rights reserved.
//

#import "OneTableViewCell.h"

//ThirdParty
#import "UIImageView+WebCache.h"

@implementation OneTableViewCell

- (void)dealloc
{
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self createViewCell];
    }
    return self;
}
#pragma mark -
#pragma mark createViewCell
- (void)createViewCell
{
    //标题
    _labelTitleOne_rec = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 198, 50)];
    _labelTitleOne_rec.textColor = [UIColor blackColor];
    _labelTitleOne_rec.numberOfLines = 0;
    _labelTitleOne_rec.font = [UIFont boldSystemFontOfSize:16];
    [self.contentView addSubview:_labelTitleOne_rec];
    [_labelTitleOne_rec release];
    //时间
    _labelTimeOne_rec = [[UILabel alloc] initWithFrame:CGRectMake(_labelTitleOne_rec.frame.origin.x, _labelTitleOne_rec.frame.origin.y + _labelTitleOne_rec.frame.size.height + 8, 100, 14)];
    _labelTimeOne_rec.textColor = myColor_dark;
    _labelTimeOne_rec.font = [UIFont systemFontOfSize:12];
    [self.contentView addSubview:_labelTimeOne_rec];
    [_labelTimeOne_rec release];
    //图片
    _imageOne_rec = [[UIImageView alloc] initWithFrame:CGRectMake(_labelTitleOne_rec.frame.origin.x + _labelTitleOne_rec.frame.size.width + 6, _labelTitleOne_rec.frame.origin.y, 96, 72)];
    _imageOne_rec.backgroundColor = myColor_dark;
    [self.contentView addSubview:_imageOne_rec];
    [_imageOne_rec release];
    //tag标记
    _tagLabel = [[UILabel alloc] initWithFrame:CGRectMake(_labelTimeOne_rec.frame.origin.x + _labelTimeOne_rec.frame.size.width, _labelTimeOne_rec.frame.origin.y, 40, _labelTimeOne_rec.frame.size.height)];
    [self.contentView addSubview:_tagLabel];
    [_tagLabel release];
}

#pragma mark 方法传值
- (void)setData:(FoucusImageModel *)model
{
    _labelTitleOne_rec.text = model.image_title;
    _labelTimeOne_rec.text = model.image_time;
    [_imageOne_rec sd_setImageWithURL:[NSURL URLWithString:model.image_smallPic] placeholderImage:[UIImage imageNamed:@"Loading.png"]];
}
- (void)createTagLabel:(NSString *)text
{
    _tagLabel.text = text;
    _tagLabel.textAlignment = NSTextAlignmentCenter;
    _tagLabel.font = [UIFont boldSystemFontOfSize:12];
    _tagLabel.textColor = [UIColor whiteColor];
}

#pragma mark -
- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
